package org.pandaria.war3.w3g.analyseur;

import java.io.FileInputStream;
import java.io.IOException;

public class W3GFile {
	
	private W3GHeader header;
	
	private W3GSubHeader subHeader;
	
	public W3GFile(){
		header = new W3GHeaderV07Format();
		subHeader = new W3GSubHeaderV07Format();
	}
	
	public void parse(String url) throws IOException{
		
		FileInputStream w3gFile = new FileInputStream(url);
		
		int offset = 0;
		
		offset += header.parse(w3gFile);

		offset += subHeader.parse(w3gFile);
		
	}
	
	public static void main(String[] args){
		
		try {
			W3GFile w3gFile = new W3GFile();
			w3gFile.parse("exemples/lag.w3g");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}
